how to calculate the density